Replication materials for "Turnout Turnaround: Ethnic Minority Victories Mobilize White Voters"
Stephanie Zonszein and Guy Grossman


./data contains the 'final' data for analysis and codebook, and the 'raw' data to compute the final data for analysis.
./code contains the code to replicate the figures and tables in the article and appendix, and the code to compute the final data for analysis.
./output contains the tables and figures produced by the code that replicates tables and figures.

*NOTE 1 DATA*
- The 'raw' data does not include the British Election Study datasets. (We use these datasets for Appendix Tables C.1 and D.2).
- Terms and conditions of use include "3. Not to share or give access to the data to any third party who has not agreed to these conditions" (See https://www.britishelectionstudy.com/terms-and-conditions-of-data-use/).
- To download the data used in this project, go to https://www.britishelectionstudy.com/data-objects/cross-sectional-data/
and agree to the terms and conditions by downloading.
- The names of files when downloaded were:
bes_rps_2019_1.0.0.dta
bes_f2f_2017_v1.5.dta
bes_f2f_2015_v4.0.dta

*NOTE 2 DATA*
- The 'raw' 2017 candidates data includes a subset of variables from the 2017 Parliamentary Candidates UK Project dataset.
- This subset of variables includes only the variables used in this study.
- For access to all variables, including for example the education level, job/trade of MPs see http://www.parliamentarycandidates.org/ or contact Dr. Jennifer Hudson (UCL).



SOFTWARE:

R version 4.3.1 (2023-06-16)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.4.1

other attached packages:
maptools_1.1-8  sp_2.0-0      dummies_1.5.6     haven_2.5.3       readxl_1.4.3      stringr_1.5.0
rddensity_2.4     estimatr_1.0.0 RATest_0.1.9   gridExtra_2.3  
rdrobust_2.0.3    sf_1.0-14         ggplot2_3.3.6     xtable_1.8-4      data.table_1.14.8


DESCRIPTION OF FILES IN ./code:

*02_compute_tables_figures.R
---replicates *all* tables and figures in the article and manuscript

*01_clean_data_analysis.R
---cleans and wrangles 'raw' data to compute the 'final' data used as input to replicate tables and figures in file 02_compute_tables_figures.R

*./interpolation 2010 2005/vote_interpolation_from_2010_to_2005.R estimates 2010 GE results under 2005 constituency boundaries

*./interpolation 2010 2005/interpolation_programme.R
---is a function used in file vote_interpolation_from_2010_to_2005.R.
The source of this function is: Goplerud, Max. (2016). "Crossing the Boundaries: An Implmentation of Two Methods for Projecting Data across Boundary Changes." Political Analysis. 24(1): 121-129.


DESCRIPTION OF FILES IN ./data:

*./clean/
---includes the 'final' data used as input in file 02_compute_tables_figures.R, and the codebook of this final data, including the sources and links to 'raw' data

*./bes/
---this is an empty folder. Store in here the crossectional data from The British Election Study 2015, 2017, 2019 after downloading to replicate the 'cleaning and wrangling' process of these datasets in lines 757--913 of file './code/01_clean_data_analysis.R'

*./candidates/
---includes data of candidates for UK GE 2005-2019; including number of valid votes, ethnic background, gender, party, incumbency status.

*./interpolation 2010 2005/
---includes data and shapefiles used as input in file vote_interpolation_from_2010_to_2005.R

*./nationality mapping/
---includes data mapping countries to nationalities, and countries to sub-regions. These are use to classify candidates' origin countries into geographical sub-regions.

*./constituency shapefiles/
---includes shapefiles of 2010 constituency boundaries. *Note* that you may need to unzip after downloading from Dataverse.






